package org.zhadoop.stream.cql.semanticanalyzer.parser.context;

import org.zhadoop.stream.cql.CQLUtils;
import org.zhadoop.stream.cql.exception.SemanticAnalyzerException;
import org.zhadoop.stream.cql.semanticanalyzer.analyzecontext.expressiondesc.ExpressionDescribe;
import org.zhadoop.stream.cql.semanticanalyzer.parsecontextreplacer.ParseContextReplacer;
import org.zhadoop.stream.cql.semanticanalyzer.parsecontextwalker.ParseContextWalker;

/**
 * 常量表达式解析的内容
 * @author zwd
 *
 */
public class ConstantContext extends BaseExpressionParseContext{

	private Class<?> datatype;
	
	private Object value;
	
	
	public ConstantContext(Class<?> dataType, Object value) {
		super();
		this.datatype = dataType;
		this.value = value;
	}
	
	

	public Class<?> getDatatype() {
		return datatype;
	}



	public void setDatatype(Class<?> datatype) {
		this.datatype = datatype;
	}



	public Object getValue() {
		return value;
	}



	public void setValue(Object value) {
		this.value = value;
	}



	@Override
	public void walkChildAndReplace(ParseContextReplacer replacer) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected ExpressionDescribe createExpressionDesc() throws SemanticAnalyzerException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toString() {
		return CQLUtils.constantToString(datatype,value);
	}

	@Override
	protected void walkChild(ParseContextWalker walker) {
		// TODO Auto-generated method stub
		
	}

}
